fix(bridge): correct error wrapping, trace_id key, and a log message#1095
Merged
Conversation
Three diagnostics/observability fixes (no behavior change to fund flow):
1. bridge.go: the tfchain and stellar subscription error branches checked
`data.Err != nil` but wrapped the stale outer-scope `err`, so a real
subscription failure was reported with the wrong/empty cause. Wrap
`data.Err` in both arms.
2. stellar.go: the `stellar_transaction_submitted` success log read the
trace id with the string key `ctx.Value("trace_id")`, but the value is
stored under the typed key `TraceIdKey{}`, so trace_id was always
logged as <nil>. Use `TraceIdKey{}`.
3. client.go: RetrySetWithdrawExecuted (which calls
SetBurnTransactionExecuted) logged "setting refund transaction as
executed". Corrected to "burn transaction".
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three small diagnostics/observability fixes in the bridge, decomposed out of the larger #1079 work. No change to fund flow or control flow — purely what gets logged/reported. Bridge-only, no runtime upgrade.
Changes
1. Wrong error variable wrapped in
Bridge.Start(bridge.go:149,193)Both subscription arms check
data.Err != nilbut wrap the stale outer-scopeerr:A real subscription failure was therefore reported with the wrong (often nil/empty) cause, masking the actual error on the bridge's exit path. Fixed to wrap
data.Errin both arms.2.
trace_idalways logged as<nil>(stellar.go:371)The
stellar_transaction_submittedsuccess log read the trace id with the string keyctx.Value("trace_id"), but the value is stored under the typed keyTraceIdKey{}(set inCreatePaymentWithSignaturesAndSubmit/CreateRefundPaymentWithSignaturesAndSubmit). So every submitted-tx log line emittedtrace_id=<nil>. Note the sibling underfunded-alert log atstellar.go:356already usesTraceIdKey{}correctly — this aligns the success log with it.3. Copy-paste log message (
client.go:66)RetrySetWithdrawExecutedcallsSetBurnTransactionExecutedbut logged"error while setting refund transaction as executed". Corrected to"burn transaction".Logic reasoning & regression-vector verification
data.Err != nil, sodata.Erris guaranteed non-nil where it's now wrapped — strictly more correct, no nil-wrap risk. Control flow unchanged (still returns).ctxreachingsubmitTransactionisctx_with_trace_id(carriesTraceIdKey{}), so the value resolves correctly now. Pure logging value; no control-flow effect.Testing
go build ./...— OKgo vet ./...— OKgofmt -l— clean🤖 Generated with Claude Code